#include "euler.h"
#include "func_lib.h"

int main(int argc, char** argv)
{
    char reply = 0;
    printf("Do you want to set everything manually?[y/n]\t");
    scanf("%c", &reply);

    double a, b, c, y_a, dy_a;
    int N, curve_num;

    if (reply == 'y')
    {
        printf("print a:\t");
        scanf("%lf", &a);
        
        printf("print b:\t");
        scanf("%lf", &b);
        
        printf("print c:\t");
        scanf("%lf", &c);
 
        printf("print y_a:\t");
        scanf("%lf", &y_a);
        
        printf("print dy_a:\t");
        scanf("%lf", &dy_a);
        
        printf("print N:\t");
        scanf("%d", &N);
 
        printf("print curve_num:\t");
        scanf("%d", &curve_num);
   } else 
   {
        a = 0; b = 10; c = 10;
        y_a = 0; dy_a = 0;
        N = 100; curve_num = 5;
   }

   int i = 0;
   double dy = c / ((double) curve_num);
   
   for (i=0; i <= curve_num; i++)
   {
        euler(a, b, y_a + i*dy, dy_a,
              p_function, q_function, N);
   }

   return 0;
}
